#ifndef GLHELPER_TEXTURE
#define GLHELPER_TEXTURE
#include "GLHelper/ITexture.hpp"
#include <Windows.h>
#include <gl/GL.h>
namespace GLHelper{
class Texture : public ITexture
{
public:
	Texture(unsigned width,unsigned height,unsigned textureName):
	 m_Width(width)
	,m_Height(height)
	,m_TextureName(textureName)
	{
	}
	~Texture()
	{
		if(m_TextureName)
		{
			glDeleteTextures(1,&m_TextureName);
			m_TextureName = 0;
		}
	}
	virtual void Bind()const
	{
		glEnable(GL_TEXTURE_2D);
		glBindTexture(GL_TEXTURE_2D,m_TextureName);
	}
	virtual void UnBind()const
	{
		glBindTexture(GL_TEXTURE_2D,0);
		glDisable(GL_TEXTURE_2D);
	}
	virtual unsigned Width()const
	{
		return m_Width;
	}
	virtual unsigned Height()const
	{
		return m_Height;
	}
private:
	unsigned m_Width;
	unsigned m_Height;
	unsigned m_TextureName;
};
}//GLHelper
#endif